home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_497 / nlcalc / calc.doc < prev    next >
Text File  |  1992-05-06  |  12KB  |  268 lines

  1. OVERVIEW:
  2.  
  3. Calc is a simple calculator program that turns your keypad into a calculator.
  4. Unlike the calculator on the Workbench disk, however, this calculator can
  5. appear on any screen where you may need it.  Also, Calc does not open its
  6. window right away.  It waits in the background for you to press the F1 key
  7. (or any key that you specify), and then opens its window.  This way, it's 
  8. there when you want it, and only when you want it.  
  9.  
  10.  
  11. HOW TO START CALC:
  12.  
  13. You should place Calc in your C: directory (or in your current path), and
  14. Calc-Handler should be put in the L: directory (or in the current directory).
  15. To start Calc, simply type Calc at the CLI prompt:
  16.  
  17.     1> Calc
  18.  
  19. You do not need to RUN Calc, since Calc loads the handler code separately,
  20. sets up the handler, and then exits.  To remove the Calc handler, simply 
  21. issue the Calc command a second time.  Calc takes about 15.5 K of memory 
  22. while it is installed and dormant.
  23.  
  24. You can make Calc part of your standard working environment by adding
  25. the "CALC" command (or "CALC > NIL:") to the startup-sequence file in the
  26. S: directory on your boot disk.
  27.  
  28.  
  29. HOW TO USE CALC:
  30.  
  31. Calc does not actually open its window until you ask it to, so when you start
  32. Calc, nothing will seem to happen (except Calc's startup message will appear).
  33. In order to tell Calc that you are ready to use the calculator, press the F1
  34. key.  This signals Calc to open its calulator window on the currently active
  35. screen.  (You may change the key that brings up the calculator, see CHANGING
  36. THE ACTIVATION KEY, below).
  37.  
  38. Calc can open on any type of screen except a HAM screen (it will still open,
  39. but it may look very strange).  It will appear flattened on interlaced or
  40. lo-res screens.  Calc uses the colors of the screen where it opens, so there
  41. should be some contrast in the colors in order to make it possible to see the
  42. legends on the keypad.
  43.  
  44. Calc now sports the New Look, a method of designing gadgets and imagery that 
  45. make them look 3-dimensional.  This should make Calc look more solid and
  46. real than previous versions of Calc, but this effect can be lost if the screen 
  47. colors are not set up properly.  The colors you choose should satisfy the 
  48. following conditions:  color 0 (the background color) should be a medium dark 
  49. color; color 1 (the usual text and menu-bar color) should be the lightest 
  50. color; color 2 (used in the depth gadgets) should be a medium bright color; 
  51. and color 3 (the CLI cursor color) should be the darkest color (notice that 
  52. the relationship of colors 2 and 3 are reversed from the default Intuition
  53. settings;  this has the advantage of making the keys appear correctly even
  54. on one-bit-plane screens).  You should use the Palette Tool or Preferences 
  55. to experiment until you find a color-scheme that suits your taste, but that 
  56. still gives the 3D effect.  A reasonable grey-scale setup would have
  57. Palette-Tool values 454 FFC 997 000.  (Monitors differ, so these values may 
  58. need to be adjusted to suit your monitor and lighting conditions).  More 
  59. colorful combinations also are possible.  (For more complete information on 
  60. the New Look, see the documentation for the NL-Daemon, which is a program 
  61. that implements the New Look for standard Intuition windows and gadgets.)
  62.  
  63. You can move the Calc window via its drag bar and its front and back gadgets.
  64. When you are done using the calculator for the moment, you can click its
  65. close gadget.  This causes the calculator to be closed temporarily, but if
  66. you press the activation key (usually F1) again, it will appear again where 
  67. you left it, with all pending operations still active.  You can pick up right 
  68. where you left off.
  69.  
  70. You can use the button gadgets on the screen to enter numbers and operations,
  71. or you can use the numeric keypad.  The keys should correspond to those 
  72. pictured on the screen, that is, pressing numbers on the keypad is equivalent
  73. to clicking on the number gadgets; pressing '+' on the keypad is the same as
  74. clicking on the plus gadget, etc.  When you press a key on the keypad, its 
  75. corresponding screen images will invert to indicate which key has been pressed.
  76.  
  77. There are five functions that do not appear on the keypad.  These are the sign
  78. change, square root, percent, clear all, and cancel entry keys.  The
  79. keyboard equivalents of these are:
  80.  
  81.             Function        Keyboard Equivalent
  82.             --------        -------- ----------
  83.              +/-                 \  key
  84.              root                `  key
  85.               %                  %  key (shift 5)
  86.               C                 DEL key
  87.               CE                BackSpace key
  88.               =                 Return or ENTER key
  89.  
  90. The numeric keys on the main keyboard also activate the calculator keys,
  91. as do the +,-,*,/,(,) and . keys.  Note that the CE function does not have a 
  92. keyboard representation on the screen.  Instead, clicking in the display
  93. area activates this function.
  94.  
  95. Functions are performed in the correct order of precedence, so if you type
  96.  
  97.         1 + 2 * 3 =
  98.  
  99. Calc will correctly respond with 7, since 1 + 6 = 7.  You can change the
  100. order of operations by using the parenthesis keys.  For example:
  101.  
  102.         2 * (1 + 3) =
  103.  
  104. will display the answer 8.  Up to twenty pending operations can be 
  105. stored at once this way.
  106.  
  107.  
  108. THE CALC DISPLAY:
  109.  
  110. The Calc display can show up to 13 characters of data, but it does not
  111. handle scientific notation, so the range of numbers is limited to 13 digits,
  112. although internal storage can sometimes exceed this limit.  Attempts to use
  113. numbers larger than this will result in an overflow error.
  114.  
  115. As a visual aid, when you are entering a new number, the display will not
  116. show a decimal point until you actually press it.  That is, as you enter an
  117. integer value, no decimal is displayed.  This way, if a decimal is showing 
  118. (and the value is an integer), you can tell whether you are in the middle of
  119. entering a number or not.
  120.  
  121. If you attempt to close the screen while Calc is still open on the screen, 
  122. Calc will detect the screen close and will close itself automatically.  This
  123. makes Calc safe to use on other screens, even if you forget to close it
  124. before exiting from the application owning the screen.
  125.  
  126.  
  127. CHANGING THE ACTIVATION KEY:
  128.  
  129. If you want to use a function key other than F1 to call up the calculator, 
  130. simply include the function key name as a parameter to the Calc command.
  131. For instance,
  132.  
  133.         1> Calc F10
  134.  
  135. Will cause Calc to use the F10 key in place of the F1 key as its activation
  136. key.  Any of the function keys can be specified in this way.  If you want to
  137. use a key other than a function key, you must specify its HEX keycode (these
  138. are listed in the AmigaDOS Developer's Manual).  For example, on an Amiga 1000, 
  139.  
  140.         1> Calc 0x45
  141.  
  142. would tell Calc to use the ESC key to call up a calculator.
  143.  
  144. If your function keys normally have other functions bound to them, you may
  145. want to specify that certain qualifier keys must be held down at the same
  146. time the activation key is pressed before Calc will open on a new screen
  147. (qualifier keys are the shift, Alt, Amiga, Control and CapsLock keys).
  148. To specify the left-hand shift key together with function key 10 as the
  149. activation sequence for Calc, issue the command:
  150.  
  151.         1> Calc LSHIFT F10
  152.  
  153. If you specify more than one qualifier key, then they ALL must be held
  154. simultaneously (together with the specified activation key) in order to
  155. activate Calc.
  156.  
  157. Qualifier keys are especially useful if you want to use a non-Fkey as the
  158. activation key.  For instance, Calc LAMIGA C would use left-amiga C as the
  159. activation sequence, while Calc RALT 0x43 would use the right-alt together
  160. with the keypad ENTER key as the activation sequence.
  161.  
  162. The names for the qualifier keys are:
  163.  
  164.         LSHIFT          Left Shift Key
  165.         RSHIFT          Right Shift Key
  166.         CAPSLOCK        The Caps Lock Key
  167.         CONTROL         The Control Key
  168.         LALT            The Left ALT Key
  169.         RALT            The Right ALT Key
  170.         LAMIGA          The Left Amiga Key
  171.         RAMIGA          The Right Amiga Key
  172.         
  173.         SHIFT,ALT, and AMIGA  refer to the LEFT key of each type
  174.         LCOMMAND,RCOMMAND     are synonyms for LAMIGA and RAMIGA
  175.  
  176.  
  177. USING CALC WITH SWINDOWS AND NL-DAEMON:
  178.  
  179. Calc can take advantage of sWindows and NL-Daemon if you wish.  Normally,
  180. Calc includes the code to handle the functions of both of these utilities
  181. so that you can run Calc independent of them.  You may wish to take advantage
  182. of these utilities and save a little space.  If so, you can recompile Calc
  183. using flags -dSWINDOWS and -dNL_DAEMON (either or both) to remove the
  184. unnecessary code from Calc (you can save about 1K this way).
  185.  
  186. Calc should function exactly the same (provided you have sWindows and 
  187. NL-Daemon running) with one minor change.  If you attempt to close the screen 
  188. where Calc is currently open, the screen will remain open until you close 
  189. Calc, then the screen will close (this is a feature of sWindows).  Normally, 
  190. Calc would detect the screen closing and close itself quietly until you 
  191. pressed the activation key again.
  192.  
  193. Compiling with the -dSWINDOWS flag removes the code from Calc that handles
  194. opening the Calc window on the active screen (sWindows will do this for you).
  195. Using Calc compiled with this flag but without having sWindows running will
  196. mean that Calc will only open on the Workbench screen.
  197.  
  198. Compiling with the -dNL_DAEMON flag removes the code from Calc that adds 
  199. the New Look imagery to the Intuition gadgets (NL-Daemon does this for you).
  200. Using Calc compiled with this flag but without having NL-Daemon running will
  201. mean that Calc will have standard Intuition depth, close and drag bars.  The
  202. Calc gadgets themselves are not affected.
  203.  
  204.  
  205. CHANGES FROM VERSION 2:
  206.  
  207. Version 3 now comes as two separate components:  the loader and the handler.
  208. This reduces the memory requirements as the start-up and clean-up portions
  209. of the code are not kept in memory all the time.
  210.  
  211. A consequence is that you no longer have to RUN Calc.  Instead, Calc now
  212. loads the handler code, and then exits, leaving the handler in memory.
  213.  
  214. Another consequence of this is that CTRL-C no longer will cause Calc to
  215. remove itself from the system.  Instead, you must explicitly call Calc a 
  216. second time so that it can remove the handler and clean up for it.
  217.  
  218. Calc now lets you specify which key and qualifiers are used to call up
  219. the calculator window.
  220.  
  221. Calc now sports the New Look and requires more care in the choice of screen
  222. colors (see HOW TO USE CALC above).
  223.  
  224. Calc can take advantage of the sWindows and NL-Daemon utilities (via 
  225. compile-time options that remove similar code from Calc).
  226.  
  227. The display code for Calc has been re-written to save about 4K of memory.
  228.  
  229.  
  230. COMPILING CALC:
  231.  
  232. Calc was developed using the Lattice C compiler v4.0 on a 512K
  233. Amiga 1000.  It probably will need to be modified to work with the
  234. Manx Aztec C compiler.  To compile and link Calc, use the following 
  235. commands (these appear in Calc.com, distributed with the source code):
  236.  
  237.         1> lc -v -b0 -M cMain cSetup cFunc cKeys cHandler  cLoader
  238.         1> lc -v -b0 -M -ad cImage
  239.         1> asm cStubs
  240.         1> asm c
  241.         1> blink with cHandler.lnk
  242.         1> blink with cLoader.lnk
  243.  
  244. The -v -b0  and -ad options are required.  The -M is to compile only those 
  245. source files that have been updated since the last compile.
  246.  
  247. To compile Calc so that it takes advantage of sWindows and NL-Daemon,
  248. use the following commands (which are in SmallCalc.com):
  249.  
  250.         1> lc -v -b0 -M -dSWINDOWS -dNL_DAEMON cMain cSetup cFunc cKeys
  251.         1> lc -v -b0 -M -dSWINDOWS -dNL_DAEMON cHandler cLoader
  252.         1> asm cSmallStubs 
  253.         1> asm c
  254.         1> blink with cSmallHandler.lnk
  255.         1> blink with cLoader.lnk
  256.  
  257.  
  258. AUTHOR:
  259.  
  260. Calc and Calc-Handler
  261. Copyright (c) 1989 by Davide P. Cervone, all rights reserved.
  262.  
  263. Davide P. Cervone
  264. Department of Mathematics, Box 1917                 ST402523@BROWNVM.BITNET
  265. Brown University                                    st402523@brownvm.brown.edu
  266. Providence, Rhode Island  02912                     dpvc@fermat.math.brown.edu
  267.  
  268.